package cn.crdeng.Service;

import cn.crdeng.po.Blog;
import cn.crdeng.po.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;


public interface BlogService {
    //保存
    Blog save(Blog blog);

    //删除
    void delete(Long id);

    //分页查询
    Page<Blog> listBlog(Pageable pageable, BlogQuery blogQuery);

    //更新
    Blog update(Long id, Blog blog);

    //根据ID查询
    Blog getBlogByID(Long id);

    //更新
    Blog updateBlog(Long id, Blog blog);

    //查询
    Page<Blog> listBlog(Pageable pageable);

    //查询所有推荐博客
    List<Blog> listRecommendBlogTop(Integer size);

    //搜索
    Page<Blog> searchBlog(String query, Pageable pageable);

    //转换博客
    Blog getAndConvert(Long id);

    //根据标签ID查询
    Page<Blog> listBlogByTagId(Pageable pageable,Long id);
    //归档
    LinkedHashMap<String,List<Blog>> archive();
    //查询次数
    int addViews(Long id);
}
